<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>xiaoniu-registry | 菜牛注册中心 - 实例管理</title>
    <script type="text/javascript" src="/frontend/template/js/instance.js"></script>
    <!-- Bootstrap CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" />
    <!-- Bootstrap Icons -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css" rel="stylesheet">
    <style>
        body {
            background-color: #f8f9fa;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }
        .main-container {
            background: white;
            border: 1px solid #dee2e6;
            margin: 1rem;
            padding: 1.5rem;
        }
        .header-section {
            text-align: center;
            margin-bottom: 1.5rem;
            padding-bottom: 1rem;
            border-bottom: 1px solid #dee2e6;
        }
        .header-title {
            color: #495057;
            font-weight: 600;
            font-size: 1.8rem;
            margin-bottom: 0.5rem;
        }
        .header-subtitle {
            color: #6c757d;
            font-size: 0.9rem;
            margin-bottom: 0;
        }
        .service-info {
            background: #e9ecef;
            padding: 0.75rem 1rem;
            margin-bottom: 1rem;
            border-left: 4px solid #007bff;
        }
        .service-info h5 {
            margin: 0;
            font-size: 1rem;
            color: #495057;
        }
        
        .refresh-btn {
            background: #007bff;
            border: 1px solid #007bff;
            padding: 0.5rem 1rem;
            font-size: 0.9rem;
        }
        .refresh-btn:hover {
            background: #0056b3;
            border-color: #0056b3;
        }
        .instance-section {
            border: 1px solid #dee2e6;
            padding: 1rem;
        }
        .section-title {
            color: #495057;
            font-weight: 600;
            margin-bottom: 1rem;
            font-size: 1rem;
        }
        .section-title i {
            margin-right: 0.5rem;
            color: #007bff;
        }
        .loading-container {
            text-align: center;
            padding: 2rem;
        }
        .loading-text {
            margin-top: 1rem;
            color: #6c757d;
            font-size: 0.9rem;
        }
        .table {
            margin-bottom: 0;
        }
        .table thead th {
            background: #f8f9fa;
            color: #495057;
            border-bottom: 2px solid #dee2e6;
            font-weight: 600;
            padding: 0.75rem;
            font-size: 0.9rem;
        }
        .table tbody td {
            padding: 0.75rem;
            vertical-align: middle;
            border-color: #dee2e6;
            font-size: 0.9rem;
        }
        .table tbody tr:hover {
            background-color: #f8f9fa;
        }
        .btn-sm {
            padding: 0.25rem 0.5rem;
            font-size: 0.8rem;
            margin: 0 0.1rem;
        }
        .status-badge {
            padding: 0.25rem 0.5rem;
            font-weight: 500;
            font-size: 0.8rem;
        }
        .status-healthy {
            background: #d4edda;
            color: #155724;
            border: 1px solid #c3e6cb;
        }
        .status-unhealthy {
            background: #f8d7da;
            color: #721c24;
            border: 1px solid #f5c6cb;
        }
        .alert {
            padding: 1rem;
            margin-top: 1rem;
            font-size: 0.9rem;
        }
        @media (max-width: 768px) {
            .main-container {
                margin: 0.5rem;
                padding: 1rem;
            }
            .header-title {
                font-size: 1.5rem;
            }
        }
    </style>
</head>
<body>
<div class="container-fluid">
    <div class="main-container">
        <!-- Header Section -->
        <div class="header-section">
            <h1 class="header-title">
                <i class="bi bi-hdd-network"></i>
                xiaoniu-registry
            </h1>
            <p class="header-subtitle">菜牛注册中心 - 服务实例管理</p>
        </div>

        <!-- Service Info Section -->
        <div class="service-info">
            <h5 id="name">
                <i class="bi bi-server"></i>
                正在加载服务信息...
            </h5>
        </div>

        <!-- Instance List Section -->
        <div class="instance-section">
            <div class="d-flex justify-content-between align-items-center mb-3">
                <h6 class="section-title mb-0">
                    <i class="bi bi-list-ul"></i>
                    实例列表
                </h6>
                <button type="button" class="btn btn-primary refresh-btn" onclick="search()">
                    <i class="bi bi-arrow-clockwise"></i>
                    刷新
                </button>
            </div>
            <div id="instance">
                <div class="loading-container">
                    <div class="spinner-border text-primary" role="status">
                        <span class="visually-hidden">Loading...</span>
                    </div>
                    <div class="loading-text">正在加载实例数据...</div>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- Bootstrap JS -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>